package com.pearl.jacksoncore.demo.feature;

/**
 * @author TD
 * @version 1.0
 * @date 2024/4/3
 */
public class MyData<T> {
    private T value;

    // 私有构造函数，通过构建器来创建实例
    private MyData(T value) {
        this.value = value;
    }

    // 构建器类，用于构建 MyData 的实例
    public static class Builder<T> {
        private T value;

        public Builder<T> withValue(T value) {
            this.value = value;
            return this;
        }

        public MyData<T> build() {
            return new MyData<>(value);
        }
    }

    // 获取器
    public T getValue() {
        return value;
    }
}
